'''
Desc: 无界面查询天气https://api.map.baidu.com/weather/v1/?district_id=222405&data_type=all&ak=uz0Bo4eMgdGnkCyFtfkfws0FibuC1m4H
Author: 陈爱国
Date: 2024-09-01 16:40:37
需安装requests: pip install requests
'''
import requests
import json

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36'
}

# city_name = input()
weather_url = 'https://api.map.baidu.com/weather/v1/?district_id=222405&data_type=all&ak=uz0Bo4eMgdGnkCyFtfkfws0FibuC1m4H'
city_response = requests.get(weather_url, headers=headers)
weather_dict = json.loads(city_response.text)
print(type(weather_dict))
print(weather_dict)


